package com.hziee.mail.dao;

import com.hziee.mail.model.AddressInfoEntity;
import com.hziee.mail.model.ProductClassInfoEntity;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.repository.CrudRepository;

import java.util.List;

/**
 * @author ZX
 */
public interface AddressRepository extends JpaRepository<AddressInfoEntity, Integer>, CrudRepository<AddressInfoEntity, Integer> {

    /**
     * 查询用户地址 按默认地址排序
     *
     * @param userId
     * @return
     */
    List<AddressInfoEntity> findAllByUserIdOrderByDefaultAddressDesc(Integer userId);
}
